package de.fhkl.graphics;

public class Matrix {

   public static void build_matrix(float m[], float q[]) {

          m[0] = (float) (1.0 - 2.0 * (q[1] * q[1] + q[2] * q[2]));
          m[1] = (float) (2.0 * (q[0] * q[1] - q[2] * q[3]));
          m[2] = (float) (2.0 * (q[2] * q[0] + q[1] * q[3]));
          m[3] = 0.0f;

          m[4] = (float) (2.0 * (q[0] * q[1] + q[2] * q[3]));
          m[5] = (float) (1.0 - 2.0 * (q[2] * q[2] + q[0] * q[0]));
          m[6] = (float) (2.0 * (q[1] * q[2] - q[0] * q[3]));
          m[7] = 0.0f;

          m[8] = (float) (2.0 * (q[2] * q[0] - q[1] * q[3]));
          m[9] = (float) (2.0 * (q[1] * q[2] + q[0] * q[3]));
          m[10] = (float) (1.0 - 2.0 * (q[1] * q[1] + q[0] * q[0]));
          m[11] = 0.0f;

          m[12] = 0.0f;
          m[13] = 0.0f;
          m[14] = 0.0f;
          m[15] = 1.0f;
      }
   
   

}
